package com.bci.internal.engine.bcibpmengine.support;


import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;

/**
 * @author jzwu
 * @since 2021/4/4 0004
 */@Data
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel("RestController方法返回结果")
public class RestResult<T> implements Serializable {

    @Builder.Default
    @ApiModelProperty(value = "状态码", required = true)
    protected Integer code = 20000;

    @Builder.Default
    @ApiModelProperty(value = "消息", required = true, position = 1)
    protected String message = "操作成功";

    @ApiModelProperty(value = "错误类别", position = 2)
    protected String error;

    @ApiModelProperty(value = "响应数据/异常说明", position = 3)
    protected T data;

    @ApiModelProperty(value = "请求路径", position = 4)
    protected String path;

    @ApiModelProperty(value = "请求动词", position = 5)
    protected String verb;
}
